package com.example.demo.service;

import com.example.demo.model.HdeUserExample;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.example.demo.mapper.HdeUserMapper;
import com.example.demo.model.HdeUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xiao.hu
 * @date 2021-09-15
 * @apiNote
 */
@Service
public class HdeUserService {

    @Resource
    private HdeUserMapper hdeUserMapper;

    public PageInfo<HdeUser> selectAll(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<HdeUser> users = hdeUserMapper.selectByExample(new HdeUserExample());
        PageInfo<HdeUser> pageInfo = new PageInfo<>(users);
        return pageInfo;
    }
}
